//
//  BBBlobEvent.h
//  BBTouch
//
//  Created by ben smith on 5/30/08.
//  This file is part of BBTouch.
//
//  BBTouch is free software: you can redistribute it and/or modify
//  it under the terms of the GNU Lesser General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.

//  BBTouch is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU Lesser General Public License for more details.

//  You should have received a copy of the GNU Lesser General Public License
//  along with BBTouch.  If not, see <http://www.gnu.org/licenses/>.
// 
//  Copyright 2008 Ben Britten Smith ben@benbritten.com .
//

#import <Cocoa/Cocoa.h>

// i could make this a child of NSEvent, but i think for now
// we will keep it simple
// implement the copying protocol so i can easily generate dupe envents for sending to a delegate

// note: I am now using the ObjC 2.0 properties to greatly simplify this object

@interface BBBlobEvent : NSObject <NSCopying> {
	NSPoint blobLocation; // this is the raw blob location in 'camera coordinates'
	NSPoint screenLocation; // this is the normalized location, between 0..1,0..1
	
	int blobID;
	float radius;
	float deltaX; // this is the change in X of the screen location (aka the speed)
	float deltaY; // this is the change in Y of the screen location (aka the speed)
	float acceleration; // this is the change in velocity of the screen location

	// the active flag is to tell me when the blob gets 'old' and needs to blob up and
	// be removed
	BOOL active;
}

@property (assign) int blobID;
@property (assign) float deltaX;
@property (assign) float deltaY;
@property (assign) float acceleration;
@property (assign) BOOL active;
@property (assign) float radius;

@property (assign) NSPoint screenLocation;
@property (assign) NSPoint blobLocation;


- (id)copyWithZone:(NSZone *)zone;
- (id)initWithLocation:(NSPoint)aPoint blobID:(int)anId;;
- (void)markInactive;
- (void)updateScreenLocation:(NSPoint)aPoint;

// 4 methods


@end
